package com.renaud.tvSpy;

import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.util.ArrayList;
import java.util.List;

public class VideoDevice {
	
	public static List<VideoDevice> getDevices(){
		List<VideoDevice> devices = new ArrayList<VideoDevice>();
		
		GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
		GraphicsDevice[] gs = ge.getScreenDevices();
			
		for(int i=0;i<gs.length;i++){
			VideoDevice v = new VideoDevice(gs[i]);
			devices.add(v);
		}
		
		return devices;
	}
	
	
	
	
	private GraphicsDevice device;
	private int largeur;
	private int hauteur;
	private float ratio;
	private String deviceId;



	public VideoDevice(GraphicsDevice device) {
		this.device = device;
		this.hauteur = device.getDisplayMode().getHeight();
		this.largeur = device.getDisplayMode().getWidth();
		this.ratio = this.largeur / this.hauteur;
		this.deviceId = device.getIDstring();
	}

	
	
	
	
	
	
	
	
	
	
	
	
	public String getDeviceId() {
		return deviceId;
	}

	public void setDeviceId(String deviceId) {
		this.deviceId = deviceId;
	}

	public GraphicsDevice getDevice() {
		return device;
	}

	public int getLargeur() {
		return largeur;
	}

	public int getHauteur() {
		return hauteur;
	}


	public float getRatio() {
		return ratio;
	}
	
	
	
	
	
	
}
